<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>${Inter.printOut('Add participant to Course',session.language)}</title>
    </head>
    <body>
        <div class="body">
            <h1>${Inter.printOut('Add Participant to Course',session.language)} : ${Course.get(courseid).getName()}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <form name="addParticipant" action="save_added_participant" >
              <input type="hidden" name="courseid" value="${courseid}"/>
              <label>Choose first a schedule </label>
              <g:select optionKey="id" from="${Course.get(courseid).schedules}" name="scheduleId" value="" ></g:select>
              <table>
                <thead>
                    <tr>
                        <th>${Inter.printOut('Add',session.language)}</th>
                        <g:sortableColumn property="name" title="${Inter.printOut('Name',session.language)}" />
                        <g:sortableColumn property="title" title="${Inter.printOut('Title',session.language)}" />
                    </tr>
                </thead>
                <tbody>
                <g:each in="${participantList}" status="i" var="employeeInstance">
                  <tr>
                    <td>
                      <input type="checkbox" name ="participantIds" value="${employeeInstance.id}" />
                    </td>
                    <td>
                      ${fieldValue(bean:employeeInstance, field:'firstName')} ${fieldValue(bean:employeeInstance, field:'lastName')}
                    </td>
                    <td>
                      ${fieldValue(bean:employeeInstance, field:'title')}
                    </td>
                  </tr>
                </g:each>
                </tbody>
              </table>
              <div class="buttons">
                  <span class="button">
                      <input type="submit" class="add_participant" value="Add participant" name="Add Participant"/>
                  </span>
             </div>
            </form>
        </div>
  </body>
</html>
